﻿#pragma once

#include "CEParaWrapper.h"
#include "CGrpInfWrapper.h"
#include "CResInfWrapper.h"
#include "CIdtInfWrapper.h"
#include "CStdInfManager.h"

class CConcCaculator
{
public:
    CEParaWrapper *pEParaWrapper;   // x0 -> 0
    CGrpInfWrapper *pGrpInfWrapper; // x1 -> 4
    CResInfWrapper *pResInfWrapper; // x2 -> 8
    CIdtInfWrapper *pIdtInfWrapper; // x3 -> 12
    CStdInfManager *pStdInfManager; // x4 -> 16
    TUkPkFactor tukpkFactor;        // x5 -> 20
    double yMinUnit;                // x12 -> 48

    CConcCaculator();

    void printSelf(char *captionUpper, int32_t deep);

    // sub_1000B395
    CConcCaculator *init(CResInfWrapper *pResInf, CEParaWrapper *pEPara, CGrpInfWrapper *pGrpInf,
                         CIdtInfWrapper *pIdtInf, CStdInfManager *pStdInf);

    // sub_1000B3F5
    int32_t clean();

    // sub_1000B419
    int32_t setMetric(TDLLMETRIC *metric, char flag);

    // sub_1000BEF2
    char setIdtInf(char flag);

    // sub_1000C00F
    int32_t setIdtInfExMode2();

    // sub_1000C0B0
    int32_t setIdtInfExModeN2(char flag);

    // sub_1000BCE6
    CStdInfManager *initStdInf();

    // sub_1000C187
    int32_t setResInfoIdnoAndName(int32_t idx, double factor);

    // sub_1000B4AE
    void setResInfoConc(TDLLMETRIC *metric, int32_t flag);

    // sub_1000C825
    double calcAir(int32_t idx, double idtAreaOrHeight, double idtWeight);

    // sub_1000C2E6
    int32_t isIdtBaseOnArea(int32_t idx);

    // sub_1000C544
    double calcIdtMethodVX(int32_t idtNo, double resAreaOrHeight, double idtAreaOrHeight, double idtWeight);

    // sub_1000C329
    int32_t fetchIDT_1408Ex(int32_t idtNo, double *f0, double *f1, double *f2, double *f3,
                            TDLLIDTListItem_1408Ex *idt1408);

    // sub_1000C892
    int32_t setResInfoConcM2M5(TDLLMETRIC *metric);

    // sub_1000BA78
    int32_t setBandOutConc(int32_t n, double factor, double mValue);

    // sub_1001D8F0
    int32_t setIdtTimeOfs(float fTimeOfs);

    // sub_1001D9D0
    int32_t setIdtQualitMode(int32_t nQualitMode, float fTimeWindow);

    // sub_1001DB80
    int32_t setMiscellaneous(TMiscellaneous *wParam, int32_t byCalib);
};
